#include <iostream>
using namespace std;

int main()
{
	int arr[15] = {0};
	for(int i = 0;i<12;i++)
	{
		cin >> arr[i];
	}
	
	int result = 300 - arr[0];
	
	int oneHundred = 0;
	int tmp = 0;
	for(int i = 1;i<12;i++)
	{
//		cout << result << "=" << result << "+" << "300 -" << arr[i] << endl;
		result = result + 300 - arr[i];
		while(result >= 100){
			result = result - 100;
			oneHundred++;
			if(result < 100)
			{
				tmp = result;
			}
		}
		if(result < 0)
		{
			cout << "-" << i+1 << endl;
			return 0;
		}	
	}
	int sum = oneHundred * 100 * 0.2 + oneHundred * 100 + tmp;
	cout << sum << endl;
	return 0;
}
